package top.scsoul.boot.advice;

import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ExceptionHandler;

@org.springframework.web.bind.annotation.ControllerAdvice
public class ControllerAdvice {
    @ExceptionHandler(RuntimeException.class)
    public String runtimeException(Exception e, Model model) {
        model.addAttribute("err",e.getMessage());
        return "err";
    }
}
